﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NngLevelEditor.Entities;

namespace NngLevelEditor.Tools
{
    public class Tool
    {
        private String _name;

        private String _type;
        private int _number;

        public Tool(string name)
        {
            _name = name;
        }

        public Tool(string name, string type, int number)
        {
            _name = name;
            _type = type;
            _number = number;
        }

        public Entity getEntity()
        {
            if (_name.Equals("Tile"))
            {
                Tile t = new Tile(_number, _type);
                t.LoadContent();

                return t;
            }
            else if (_name.Equals("StartTile"))
            {
                StartTile t = new StartTile(_number, _type);
                t.LoadContent();

                return t;
            }
            else if (_name.Equals("DeadTile"))
            {
                DeadTile t = new DeadTile(_number, _type);
                t.LoadContent();

                return t;
            }
            else if (_name.Equals("WinTile"))
            {
                WinTile t = new WinTile(_number, _type);
                t.LoadContent();

                return t;
            }
            else if (_name.Equals("FlyingEnemy"))
            {
                FlyingEnemy t = new FlyingEnemy(_number, _type);
                t.LoadContent();

                return t;
            }
            else if (_name.Equals("SentryEnemy"))
            {
                SentryEnemy t = new SentryEnemy();
                t.LoadContent();

                return t;
            }
            else
            {
                return null;
            }
        }

        public string ToString()
        {
            return _name;
        }

    }
}
